#include <iostream>
using namespace std;
int main()
{
    int fuck_u;
    bool num_range_judge, devide_by_2_judge; // true / false
    cin >> fuck_u;
    if ((fuck_u > 4) && (fuck_u <= 12))
    {
        num_range_judge = 1;
    }
    else
    {
        num_range_judge = 0;
    }
    if (fuck_u % 2 == 0)
    {
        devide_by_2_judge = 1;
    }
    else
    {
        devide_by_2_judge = 0;
    }

    if (num_range_judge == 1 && devide_by_2_judge == 1)
    {
        printf("1 1 0 0");
    }
    else
    {
        if ((num_range_judge == 1 && devide_by_2_judge == 0) || (num_range_judge == 0 && devide_by_2_judge == 1))
        {
            printf("0 1 1 0");
        }
        else
        {
            printf("0 0 0 1");
        }
    }

    return 0;
}